package com.lock;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author yijy
 * @description 可重入
 * @create 2021/4/2 上午10:22
 **/
public class ReentrantLockTest {

    ReentrantLock lock = new ReentrantLock();

    public static void main(String[] args) {

    }

    public void test1(){
        lock.lock();
        try {
            for(int i=0; i <10; i++){
                System.out.println();
            }
        }finally {
            lock.unlock();
        }

    }
}
